﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPI.Entities.Interface;
using PPI.Entities.Settings.Mobile;
using PPI.Mobile.Logic;

namespace PPI.ServiceLogic.Mobile
{
    public class LMobileSettings
    {
        protected EMobileSettingsBase m_Settings;

        public static void ExecuteSettings(EMobileSettingsBase Settings, string mobileConnectionString)
        {
            string _Query = "";
            foreach (IMobileSetting s in Settings.ListMobileSettings)
            {
                _Query = "Delete tb_Settings where SettingKey = '" + (Int32)s.MobileSettingKey + "'";
                LMobileDatabase.ExecuteQuery(_Query, mobileConnectionString);
                _Query = "Insert into tb_Settings (SettingKey,SettingName,SettingValue) values('" + (Int32)s.MobileSettingKey + "','"+s.Name+"',"+s.Id+")";
                LMobileDatabase.ExecuteQuery(_Query, mobileConnectionString);
            }
        }
    }
}
